package com.bbex.service.impl;

import com.bbex.entity.DivideintoLog;
import com.bbex.entity.OfflineTransferLog;
import com.bbex.mapper.DivideintoLogDao;
import com.bbex.mapper.OfflineTransferLogDao;
import com.bbex.pojo.ResponsePage;
import com.bbex.service.DivideintoLogService;
import com.bbex.service.OfflineTransferLogService;
import com.bbex.util.SnowFlake;
import com.bbex.vo.DepdrawLogVO;
import com.bbex.vo.DepositListVO;
import com.bbex.vo.DivideintoLogListVO;
import com.bbex.vo.OfflineTransferListVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class DivideintoLogServiceImpl implements DivideintoLogService {

    @Autowired
    private DivideintoLogDao divideintoLogDao;

    @Override
    public int save(DivideintoLog divideintoLog) {
        return divideintoLogDao.insertSelective(divideintoLog);
    }

    @Override
    public ResponsePage<DivideintoLogListVO> findDivideintoLogPage(DivideintoLogListVO divideintoLogListVO) {
        ResponsePage<DivideintoLogListVO> responsePage = new ResponsePage<>();
        Page<DivideintoLogListVO> page = PageHelper.startPage(divideintoLogListVO.getCurrentPage(), divideintoLogListVO.getShowCount());
        List<DivideintoLogListVO> data = null;
        data = divideintoLogDao.findDepdrawLogListByUserId(divideintoLogListVO.getUserId());
        responsePage.setCount(page.getTotal());
        responsePage.setList(data);
        return responsePage;
    }
}
